package dynamicJsonVerifyer.verifyers;

import com.alibaba.fastjson.JSONObject;
import dynamicJsonVerifyer.Const.*;
import dynamicJsonVerifyer.verifyers.FieldTypeVerifyer;

import java.util.Map;

public class EnumTypeVerifyer extends FieldTypeVerifyer {

    protected String getType() {
        return BaseVerifyDataType.enum0;
    }

    protected boolean verifyType(JSONObject verifyMetadata, Object appointVaildData) {
        String[] items = verifyMetadata.get(VaildMetadataItem.enumData).toString().split(",");
        for(String item : items){
            if(!"".equals(item) && item.equals(appointVaildData))
                return true;
        }
        return false;
    }
}
